Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

worker/server: update metrics on requeue #4461

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

croissanne
Copy link
Member

worker/server: update metrics on requeue

When requeuing a job the next worker requesting the job would decrement
pending counter, but the pending counter only ever got incremented once,
when the job was first enqueued. Thus make sure to increment the pending
counter when a job is requeued.

@croissanne croissanne changed the title Bump on requeue worker/server: update metrics on requeue Nov 5, 2024
When requeuing a job the next worker requesting the job would decrement
pending counter, but the pending counter only ever got incremented once,
when the job was first enqueued. Thus make sure to increment the pending
counter when a job is requeued.
Copy link
Contributor

@schuellerf schuellerf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, There is no explicit test for the metrics right?
Not sure if this is doable with a sane effort.
And might be a separate PR?

if requeued {
jobInfo, err := s.jobInfo(jobId, nil)
if err != nil {
return fmt.Errorf("error requeueing job: %w", err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

more like error getting job details for prometheus metrics
should we skip prometheus metrics here and try to continue, rather than fail?
although this will then probably fail some lines below…

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's very unlikely that this call will fail if the job exists.

@croissanne
Copy link
Member Author

It's definitely possible to add unit tests, I'll do that.

@schuellerf
Copy link
Contributor

Sidenote - I think the running_jobs metric also has some problems (causing it to go below 0) so we could see this in the tests if you can implement them 🥳

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants